package vn.buffalocoders.rikos.ui.common;


import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;

public class RikoBook {

	public static final String KEY_STATUS = "status";	
	public static final String KEY_BOOKS = "books";	
	
	public static final String KEY_BOOKS_SUM = "summary";
	
	public static final String KEY_BOOKS_STATUS = "status";
	public static final String KEY_BOOKS_DATE =  "createDate";
	public static final String KEY_BOOKS_ID = "id";
	public static final String KEY_BOOKS_NAME = "name";
	public static final String KEY_BOOKS_TITLE="title";
	public static final String KEY_BOOKS_NUMBER="number";
	
	public static final String KEY_BOOKS_PUBLISHER= "publisher";
	public static final String KEY_BOOKS_PUB_STATUS = "status";
	public static final String KEY_BOOKS_PUB_DATE = "createDate";
	public static final String KEY_BOOKS_PUB_ID = "id";
	public static final String KEY_BOOKS_PUB_NAME = "name";
	public static final String KEY_BOOKS_PUB_ADD = "address";
	public static final String KEY_BOOKS_PUB_LAT = "lat";
	public static final String KEY_BOOKS_PUB_LON = "lon";
	
	public static final String KEY_BOOKS_UP = "uploader";
	public static final String KEY_BOOKS_UP_STATUS = "status";
	public static final String KEY_BOOKS_UP_DATE = "createDate";
	public static final String KEY_BOOKS_UP_TOKEN = "token";
	public static final String KEY_BOOKS_UP_ID = "id";
	public static final String KEY_BOOKS_UP_DEV = "deviceId";
	public static final String KEY_BOOKS_UP_DEVTOKEN = "deviceeToken";
	public static final String KEY_BOOKS_UP_NAME = "name";
	public static final String KEY_BOOKS_UP_EMAIL = "email";	
	public static final String KEY_BOOKS_UP_AVAT = "avatar";
	public static final String KEY_BOOKS_UP_LASTLOGIN = "lastLogin";
	
	
	public static final String KEY_BOOKS_AUTHOR = "author";
	public static final String KEY_BOOKS_CHAPNUM = "chapternum";
	public static final String KEY_BOOKS_IMGCOVER = "imageCover";
	
	public static final String KEY_BOOKS_CATE_LIST = "categories";
	public static final String KEY_BOOKS_CATE = "category";
	public static final String KEY_BOOKS_CATE_ID = "id";
	public static final String KEY_BOOKS_CATE_NAME = "name";
	public static final String KEY_BOOKS_CATE_BOOKNUM = "bookNum";
	public static final String KEY_BOOKS_CATE_DATE = "createDate";
	public static final String KEY_BOOKS_CATE_IMAGE = "image";
	
	public static final String KEY_BOOKS_PRICE = "price";
	public static final String KEY_BOOKS_PRICESALE = "priceSaleOff";
	public static final String KEY_BOOKS_RANKING = "ranking";
	public static final String KEY_BOOKS_FEE = "fee";
	public static final String KEY_BOOKS_LIKE = "likeNum";
	public static final String KEY_BOOKS_VIEW = "viewNum";
	public static final String KEY_BOOKS_COMMENT = "commentNum";
	public static final String KEY_BOOKS_BOOKMARK = "pageBookMark";
	public static final String KEY_BOOKS_FILETYPE = "fileType";
	public static final String KEY_BOOKS_ACTIVE = "active";
	public static final String KEY_BOOKS_SYSTEM = "system";
	public static final String KEY_BOOKS_COMPLETED = "completed";
	
	
	
	private boolean _bStatus = false;
	private Date _createDate = null;
	private String _summary = "";
	private String _id = "";
	private String _name = "";
	private String _title = "";
	private RikoPublisher _publisher = null;
	private RikoUploader _uploader = null;
	private String _author = "";
	private Integer _chapterNum = 0;
	private String _imageCover = "";
	private ArrayList<RikoCategory> _categories = new ArrayList<RikoCategory>();
	private String _price = "";
	private String _pricesale = "";
	private Integer _fee = 1;
	private Integer _likeNum = 0;
	private Integer _viewNum = 0;
	private Integer _commentNum = 0;
	private Integer _pageBookMark = 0;
	private RikoBookType _fileType;
	private boolean _active = false;
	private boolean _system = false;
	private boolean _completed = false;
	private Integer _number = 0;
	private Integer _ranking = 0;
	
	public RikoBook(){
		
	}
	public RikoBook(String status, String createDate, String id, String name, String title)
	{
		if(status == "success")
			_bStatus = true;
		if(status == "failure")
			_bStatus = false;		
		
		this._createDate = Helper.ConvertStrToDate(createDate);
		this._id = id;
		this._name = name;
		this._title = title;
	}
	
	public RikoBook(String status, String createDate, String id, String name, String title,
			RikoPublisher publisher, RikoUploader uploader, String author, Integer chapterNum, String imageCover,
			ArrayList<RikoCategory> categories, Integer fee, Integer likeNum, Integer viewNum, Integer commentNum, 
			Integer pageBookMark, RikoBookType fileType, boolean active, boolean system, boolean completed) {
		if(status == "success")
			_bStatus = true;
		if(status == "failure")
			_bStatus = false;
		_createDate = Helper.ConvertStrToDate(createDate);
		_id = id;
		_name = name;
		_title = title;
		_publisher = publisher;
		_uploader = uploader;
		_author = author;
		_chapterNum = chapterNum;
		_imageCover = imageCover;
		_categories = new ArrayList<RikoCategory>(categories);
		_fee = fee;
		_likeNum = likeNum;
		_viewNum = viewNum;
		_commentNum = commentNum;
		_pageBookMark = pageBookMark;
		_fileType = fileType;
		_active = active;
		_system = system;
		_completed = completed;
	}
	
	public void setRanking(Integer ranking){
		_ranking = ranking;
	}
	
	public Integer getRanking(){
		return _ranking;
	}
		
	
	public void setCreateDate(String createDate){
		_createDate = Helper.ConvertStrToDate(createDate);
	
	}
	public void setTitle(String title){
		_title = title;
	}
	public Integer getNumber(){
		return _number;
	}
	
	public void setNumber(Integer number){
		_number = number;
	}
	
	public void setSummary(String summary){
		this._summary = summary;
	}
	
	public String getSummary(){
		return this._summary;
	}
	
	public void setPrice(String price){
		this._price = price;
	}
	
	public String getPrice(){
		return this._price;
	}
	
	public void setPriceSale(String pricesale){	
		this._pricesale = pricesale;
	}
	
	public String getPriceSale(){
		return this._pricesale;
	}
	
	public void setPublisher(RikoPublisher publisher)
	{
		this._publisher = publisher;
	}
	
	public void setUploader(RikoUploader uploader)
	{
		this._uploader = uploader;
	}
	
	public void setAuthor(String author)
	{
		this._author = author;
	}
	
	public void setChapterNum(Integer chapterNum) {
		this._chapterNum = chapterNum;
	}
	
	public void setImageCover(String imgCover)
	{
		this._imageCover = imgCover;
	}

	public void setCategories(ArrayList<RikoCategory> list)
	{
		this._categories = list;
	}
	
	public void addCategories(RikoCategory category)
	{
		this._categories.add(category);
	}

	public void setFee(Integer fee)
	{
		this._fee = fee;
	}
	
	public void setLikeNum(Integer likenum)
	{
		this._likeNum = likenum;
	}
	
	public void setViewNum(Integer viewnum)
	{
		this._viewNum = viewnum;
	}
		
	public void setCommentNum(Integer commentNum)
	{
		this._commentNum = commentNum;
	}
	
	public void setPageBookMark(Integer pageBookMark)
	{
		this._pageBookMark = pageBookMark;
	}
    public void setFileType(RikoBookType type)
	{
    	this._fileType = type;
	}

	public void setActive(boolean active)
	{
		this._active = active;
	}
	
	public void setSystem(boolean system)
	{
		this._system = system;
	}
	
	public void setCompleted(boolean comp)
	{
		this._completed = comp;
	}
	

	public boolean getStatus() {
		return _bStatus;
	}
	
	public void setStatus(String status){
		if(status == "success")
			_bStatus = true;
		if(status == "failure")
			_bStatus = false;
	}

	public Date getCreateDate() {
		return _createDate;
	}
	
	public String getId() {
		return _id;
	}	
	public void setId(String id){
		_id = id;
	}
	public String getName() {
		return _name;
	}
	
	public String getTitle() {
		return _title;
	}
	
	public RikoPublisher getPublisher() {
		return _publisher;
	}
	
	public RikoUploader getUploader() {
		return _uploader;
	}
	
	public String getAuthor() {
		return _author;
	}
	public Integer getChapterNum() {
		return _chapterNum;
	}
	
	public String getImageCover() {
		return _imageCover;
	}
	
	public ArrayList<RikoCategory> getCategories() {
		return _categories;
	}
	
	public Integer getFee() {
		return _fee;
	}
	
	public Integer getLikeNum() {
		return _likeNum;
	}
	
	public Integer getViewNum() {
		return _viewNum;
	}
	
	public Integer getCommentNum() {
		return _commentNum;
	}
	
	public Integer getPageBookMark(){
		return _pageBookMark;
	}
	public RikoBookType getFileType() {
		return _fileType;
	}
	
	public boolean getActive() {
		return _active;
	}
	
	public boolean getSystem() {
		return _system;
	}
	
	public boolean getCompleted() {
		return _completed;
	}
}
